<template>
<!-- 资源管理查询 -->
    <manage-public-select >
        <template slot="buttonSearch">
            <el-button style="float: right;" @click="handleselect">查询结果</el-button>
        </template>
        <template slot="searchContent">            
            <el-form ref="form" :model="form" label-width="80px">
                <el-row>
                    <el-col :span="6">
                        <div class="grid-content bg-purple-dark">
                            <el-form-item label="资源名称">
                                <el-input v-model="form.name"></el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-row>
            </el-form>
        </template>
    </manage-public-select>
</template>
<script>
import enableoptions from "@/mixins/constArrys/enableoptions.js"
import areaIdoptions from "@/mixins/requsetArrys/areaIdoptions.js"
import select_pagination from "manage-sys-libs/src/components/managePubilcPagination/mixins/select_pagination.js"
export default {
    mixins:[enableoptions,select_pagination,areaIdoptions],
    data(){
        return{
            form: {
                name: '',
            }
        }
    },
    mounted(){
        this.handleselect();
    },
    methods:{
        handleselect(){
            this.$store.dispatch("pagination/set_currentPage4", 1);
            this.getselect();  
        },
        getselect(){
            this.form.pageSize = this.$store.getters.pageSize;
            this.form.curPage = this.$store.getters.currentPage4;
            // 点击查询发送请求
            this.$store.dispatch("resource/select_resource",this.form).then(res=>{
                const { list ,  totalCount} = res;
                // 发送数据列表
                this.$parent.getlist(list)
                // this.$emit("el_getlist",list);
                // 处理分页
                this.$store.dispatch("pagination/set_total", totalCount);
            })
        }
    }
    
}
</script>